package com.ruoyi.user.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.YmProductMapper;
import com.ruoyi.user.domain.YmProductEntity;
import com.ruoyi.user.service.IYmProductService;

/**
 * Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-11-08
 */
@Service
public class YmProductServiceImpl implements IYmProductService 
{
    @Autowired
    private YmProductMapper ymProductMapper;

    /**
     * 查询
     * 
     * @param id 主键
     * @return 
     */
    @Override
    public YmProductEntity selectYmProductById(Long id)
    {
        return ymProductMapper.selectYmProductById(id);
    }

    /**
     * 查询列表
     * 
     * @param ymProductEntity 
     * @return 
     */
    @Override
    public List<YmProductEntity> selectYmProductList(YmProductEntity ymProductEntity)
    {
        return ymProductMapper.selectYmProductList(ymProductEntity);
    }

    /**
     * 新增
     * 
     * @param ymProductEntity 
     * @return 结果
     */
    @Override
    public int insertYmProduct(YmProductEntity ymProductEntity)
    {
        return ymProductMapper.insertYmProduct(ymProductEntity);
    }

    /**
     * 修改
     * 
     * @param ymProductEntity 
     * @return 结果
     */
    @Override
    public int updateYmProduct(YmProductEntity ymProductEntity)
    {
        return ymProductMapper.updateYmProduct(ymProductEntity);
    }

    /**
     * 批量删除
     * 
     * @param ids 需要删除的主键
     * @return 结果
     */
    @Override
    public int deleteYmProductByIds(Long[] ids)
    {
        return ymProductMapper.deleteYmProductByIds(ids);
    }

    /**
     * 删除信息
     * 
     * @param id 主键
     * @return 结果
     */
    @Override
    public int deleteYmProductById(Long id)
    {
        return ymProductMapper.deleteYmProductById(id);
    }

    /**
     * 根据typeId查询关联的所有产品信息
     *
     * @param typeId 检索参数
     * @return 结果
     */
    @Override
    public List<YmProductEntity> selectYmProductsByTypeId(Long typeId) {
        return ymProductMapper.selectYmProductsByTypeId(typeId);
    }
}
